<?php
/**
 * Created by PhpStorm.
 * User: 王松
 * Time: 2017/6/5 17:15
 */

namespace App\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

/**
 * 为支持老项目的表结构添加的查询作用域
 *
 * Class NotDeleteScope
 * @package App\Scopes
 */
class NotDeleteScope implements Scope
{
    public function apply(Builder $builder, Model $model)
    {
        return $builder->where('isdel', 0);
    }
}